//
//  UITableViewCell+HDPIngJiaCell.m
//  app
//
//  Created by apple on 2017/7/24.
//  Copyright © 2017年 hdaren. All rights reserved.
//

#import "HDPIngJiaCell.h"

@interface HDPIngJiaCell ()

@property (nonatomic,strong)UILabel * name;
@property (nonatomic,strong)UILabel * content;
@property (nonatomic,strong)UILabel * time;

@end

@implementation  HDPIngJiaCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.frame = CGRectMake(0, 0, UBO_SCREEN.width, 80);
        
        [self creatSubViews];
        
    }
    return self;


}

-(void)creatSubViews
{
    self.name = [[UILabel alloc]initWithFrame:CGRectOf([self.ubo fx:0 ox:12 fy:0 oy:12], [self.ubo ow:UBO_SCREEN.width-24 oh:14])];
    [self.name setFont:[UIFont systemFontOfSize:14]];
    [self.name setTextColor:[XCommon hexStringToColor:kColor_blue]];
    [self addSubview:self.name];
    
    
    self.content = [[UILabel alloc]initWithFrame:CGRectOf([self.name.ufo fx:0 ox:12 fy:1 oy:6], [self.ubo ow:UBO_SCREEN.width oh:40])];
    [self.content setFont:[UIFont systemFontOfSize:13]];
    [self.content setTextColor:[XCommon hexStringToColor:kColor_l_light_gray_text]];
    [self.content setTextAlignment:NSTextAlignmentLeft];
    self.content.numberOfLines = 0;
    self.content.lineBreakMode = NSLineBreakByCharWrapping;
    [self addSubview:self.content];
    
    
    self.time = [[UILabel alloc]initWithFrame:CGRectOf([self.ubo fx:1 ox:-(UBO_SCREEN.width-24)-12 fy:1 oy:-12-4], [self.ubo ow:UBO_SCREEN.width-24 oh:12])];
    [self.time setFont:[UIFont systemFontOfSize:12]];
    [self.time setTextColor:[XCommon hexStringToColor:kColor_m_light_gray_text]];
    [self.time setTextAlignment:NSTextAlignmentRight];
    [self addSubview:self.time];
    
    

}

-(void)cellWithModel:(NSDictionary *)dic
{
    self.name.text = dic[@"operator"];
    
    self.content.text = dic[@"evaluation"];
    
    self.time.text = dic[@"detail_created_at"];

}




@end
